<?php
	// Usage:
	// php makewebsite_base.php [<destination directory>]
	// Copies the base files to the new destination directory

	
	umask(0);
	if(isset($argv[1])){
		$webbasedir = $argv[1];
	}else{
		$webbasedir = getcwd()."/";
	}
	
	if(!file_exists($webbasedir)){
		mkdir($webbasedir,0777,1);
	}
	
	$scriptpath = $argv[0];
	$zippath = str_replace("makewebsite_base.php","QuickSiteBase.zip",$argv[0]);
	
	exec("unzip -o '".$zippath."' -d '".$webbasedir."'");
	exec("rm -rf '".$webbasedir."/__MACOSX/'");
	exit;
?>